package com.example.chatroom.common.exception;

import com.example.chatroom.common.errorcode.ErrorCode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;

@Data
public class ServiceException extends RuntimeException {
    private Integer code;
    private String msg;

    public ServiceException(ErrorCode errorCode) {
        this.code = errorCode.getErrorCode();
        this.msg=errorCode.getMsg();

    }

    public ServiceException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;

    }

    public ServiceException() {
        super();
    }
    public ServiceException(String message) {
        super(message);
    }

}
